/*  BEGIN_FILE_HDR
***********************************************************************************************
*   NOTICE                              
*   This software is the property of HiRain Technologies. Any information contained in this 
*   doc should not be reproduced, or used, or disclosed without the written authorization from 
*   HiRain Technologies.
***********************************************************************************************
*   File Name       : CanIf_Type.h
***********************************************************************************************
*   Project/Product : AUTOSAR 4.0
*   Title           : CAN Interface module type definitions head File
*   Author          : HeYang
***********************************************************************************************
*   Description     : The header file CanIf_Type.h contains the  common type definitions of
*                     the module Can Interface 
***********************************************************************************************
*   Limitations     : 
*
***********************************************************************************************
*
***********************************************************************************************
*   Revision History:
* 
*   Version     Date          Initials      CR#          Descriptions
*   ---------   ----------    ------------  ----------   ---------------
*   1.0         2010/4/2       HeYang       N/A          Original
*   2.0         2012/6/06      HeYang       N/A          modify 
*
***********************************************************************************************
* END_FILE_HDR*/

#ifndef _CANIF_TYPE_H_
#define _CANIF_TYPE_H_


#include "..\src\BSW\Comms\NM\YKBase\ComStack_Types.h"
#include  "Can_Type.h"
 /*Operating modes of the CAN Controller and CAN Driver */


typedef enum  
{
  CANIF_CS_UNINIT=0,                     /*UNINIT mode. Default mode of the CAN Driver and all CAN 
                                         controllers connected to one CAN network after power on. */
  CANIF_CS_SLEEP,                        /*SLEEP mode. At least one of all CAN controllers connected 
                                         to one CAN network are set into the SLEEP mode and can 
                                         be woken up by request of the CAN Driver or by a network 
                                         event (must be supported by CAN hardware) */
  CANIF_CS_STARTED,                      /*STARTED mode. All CAN controllers connected to one CAN 
                                         network are started by the CAN Driver and in full-operational 
                                         mode. */
  CANIF_CS_STOPPED                       /*STOPPED mode. At least one of all CAN controllers 
                                         connected to one CAN network is halted and does not 
                                         operate on the network. */

}CanIf_ControllerModeType;               /*Operating modes of the CAN Controller and CAN Driver*/

typedef enum
{
  CANIF_SET_OFFLINE =0x0,                /*0000,Channel shall be set to the offline mode
                                         => no transmission and reception */

  CANIF_SET_ONLINE=0x07,                 /*0111,Channel shall be set to online mode
                                         => full operation mode */
  CANIF_SET_RX_OFFLINE=0x06,             /*0110,Receive path of the corresponding channel
                                         shall be disabled*/
  CANIF_SET_RX_ONLINE=0x09,              /*1001,Receive path of the corresponding channel
                                         shall be enabled*/
  CANIF_SET_TX_OFFLINE=0x01,             /*0001,Transmit path of the corresponding channel
                                         shall be disabled*/
  CANIF_SET_TX_OFFLINE_ACTIVE=0x04,      /*0100,Transmit path of the corresponding channel
                                         shall be set to the offline active mode
                                         => notifications are processed but transmit
                                         requests are blocked.*/
  CANIF_SET_TX_ONLINE=0x0e               /*1110,Transmit path of the corresponding channel
                                         shall be enabled*/
}CanIf_PduSetModeType ;                  /*Request for PDU channel group. The request type of the channel 
                                         defines it's transmit or receive activity. Communication direction (transmission and/or reception)
                                         of the channel can be controlled separately or together by upper layers.*/

typedef enum
{
  CANIF_GET_OFFLINE =0,                  /*000,Channel is in the offline mode
                                         => no transmission and reception*/
  CANIF_GET_OFFLINE_ACTIVE=4,            /*100,Transmit path of the corresponding
                                         channel is in the offline active mode
                                         => transmit notifications are
                                         processed but transmit requests are blocked.
                                         The receive path is disabled.*/
  CANIF_GET_OFFLINE_ACTIVE_RX_ONLINE=5,  /*101,Transmit path of the corresponding
                                         channel is in the offline active mode
                                         => transmit notifications are
                                         processed but transmit requests are blocked.
                                         The receive path is enabled.*/
  CANIF_GET_ONLINE=7,                    /*111,Channel is in the online mode
                                         => full operation mode*/
  CANIF_GET_RX_ONLINE=1,                 /*001,Receive path of the corresponding
                                         channel is enabled and transmit path is disabled.*/
  CANIF_GET_TX_ONLINE=6                  /*110,Transmit path of the corresponding
                                         channel is enabled and receive path is disabled.*/
}CanIf_PduGetModeType ;                  /*Status of the PDU channel group. Current mode of the channel defines
                                         its transmit or receive activity. Communication direction (transmission and/or reception) 
                                         of the channel can be controlled separately or together by upper layers*/
    
typedef enum
{
  CANIF_NO_NOTIFICATION =0,              /*No transmit or receive event occurred for the requested L-PDU.*/
  CANIF_TX_RX_NOTIFICATION=1             /*The requested Rx/Tx CAN L-PDU was successfully transmitted or received.*/
}CanIf_NotifStatusType ;                 /*Return value of CAN L-PDU notification status.*/
 
 
       

#endif

